﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using Components;
using Model.Enum;

namespace UI.Lib
{
    public class Global
    {
        private static int GPIWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;

        /// <summary>
        /// 全局字体大小
        /// </summary>
        public static Font AllFont
        {
            get
            {
                return new Font(new FontFamily("宋体"), 10F);
            }
        }

        public static Color AllBGColor
        {
            get
            {
                return Color.FromArgb(253, 250, 249);
            }
        }

        public static Font ToolBarFont
        {
            get
            {
                return new Font(new FontFamily("宋体"), 9F);
            }
        }

        public static string SummaryHelpText
        {
            get
            {
                return "快捷键提示：保存: F8，返回: Page Up";
            }
        }

        /// <summary>
        /// 明细帮助
        /// </summary>
        public static string DetailHelpText
        {
            get
            {
                return "快捷键提示：保存: F8，返回: Page Up";
            }
        }

        public static DateTime MaxDate
        {
            get
            {
                return new DateTime(2999, 12, 31);
            }
        }

        public static DateTime MinDate
        {
            get { return new DateTime(1950, 1, 1); }
        }


        //该方法应该加入Validaiton中
        public static object IfNull(object v1, object v2)
        {
            return Validation.IsNull(v1) ? v2 : v1;
        }

        public static bool IsNumType(PsDataType type)
        {
            return type == PsDataType.Int
                   || type == PsDataType.IntThanZero
                   || type == PsDataType.IntThanZeroOrEqualZero
                   || type == PsDataType.Num
                   || type == PsDataType.NumThanZero
                   || type == PsDataType.NumThanZeroOrEqualZero;
        }
    }
}
